import React, { useEffect } from 'react';
import { Tabs } from 'antd';
import type { TabsProps } from 'antd';
import { ModelView } from 'bsin-workflow-ui';
import TaskProcessing from './TaskProcessing';
import ApplicationForm from './ApplicationForm';

const TaskHandle = (props: any) => {
  const items: TabsProps['items'] = [
    // {
    //   key: '1',
    //   label: `申请表单`,
    //   children: <ApplicationForm itemInfo={props.itemInfo} />
    // },
    {
      key: '2',
      label: `任务处理`,
      children: (
        <TaskProcessing
          itemInfo={props.itemInfo}
          processingModelCancel={props.processingModelCancel}
        />
      ),
    },
    // {
    //   key: '3',
    //   label: `任务转办`,
    //   children:
    //     <TransferTask itemInfo={props.itemInfo} />,
    // },
    {
      key: '4',
      label: `流程图`,
      children: (
        <ModelView
          processInstanceId={props.itemInfo?.processInstanceId}
          processDefinitionId={props.itemInfo?.processDefinitionId}
        />
      ),
    },
  ];

  const onChange = (key: string) => {
    console.log(key);
  };
  return (
    <>
      <Tabs defaultActiveKey="1" items={items} onChange={onChange} />
    </>
  );
};

export default TaskHandle;
